package com.kyivmohyla.kma2.model;

import com.google.gwt.user.client.rpc.IsSerializable;

public class Customer implements IsSerializable {
    private int customerId;
    private String firstName;
    private String lastName;
    private String address;
    private String phone;
    private String email;

    public Customer() {
    }

    public int getCustomerId() {
        return customerId;
    }

    public void setCustomerId(int customerId) {
        this.customerId = customerId;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public boolean equals(Object other) {
        return (other instanceof Customer) ? customerId == ((Customer) other).customerId
                : (other == this);
    }

    @Override
    public int hashCode() {
        return this.getClass().hashCode();
    }

    @Override
    public String toString() {
        return String
                .format("Customer(customerId = %d, firstName = %s, lastName = %s, address = %s, phone = %s, email = %s)",
                        customerId, firstName, lastName, address, phone, email);
    }
}